//
//  JinDuVC.m
//  HxgProject
//
//  Created by hxg on 2018/4/7.
//  Copyright © 2018年 XMYY-19. All rights reserved.
//

#import "JinDuVC.h"
#import "JinDuCell.h"
#import "RDVTabBarController.h"
#import "PayBackRecordInfo.h"

@interface JinDuVC ()

// 显示的数组
@property (nonatomic, strong) NSMutableArray *showArr;

@end

@implementation JinDuVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = self.showTitleStr;
    [self.tableView registerClass:[JinDuCell class] forCellReuseIdentifier:@"MyCell"];
    
    [self.tableView registerNib:[UINib nibWithNibName:@"JinDuCell" bundle:nil] forCellReuseIdentifier:@"MyCell"];
    self.tableView.tableFooterView = [[UIView alloc] init];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [[self rdv_tabBarController] setTabBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.detailApplyArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    JinDuCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell" forIndexPath:indexPath];
    
    if (!cell)
    {
        cell = [[JinDuCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    // 对cell 进行简单地数据配置
    PayBackRecordInfo *applyInfo = self.detailApplyArr[indexPath.row];
   
    cell.applyTimeInfo.text = applyInfo.applyTime;
    cell.currentStatus.text = applyInfo.curRepayStatus;
    cell.currentStatus.textAlignment = NSTextAlignmentCenter;
    
    cell.repaymentNumLbl.text = applyInfo.repaymentNum;
    
    cell.realRepaymentTimeLbl.text = applyInfo.repaymentTime;
    cell.fangkuanTimeLbl.text = applyInfo.lendingTime;
    cell.curQiShuLbl.text = applyInfo.curRepaymentPeriod;
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 196.50f;
}


@end
